#include "controls.h"

void captureEvents()
{
	oslReadKeys();
	captureHeld();
	capturePressed();
	captureReleased();
}
void captureReleased()
{
	if(osl_keys->released.up) onKeyReleased("up");
	if(osl_keys->released.down) onKeyReleased("down");
	if(osl_keys->released.left) onKeyReleased("left");
	if(osl_keys->released.right) onKeyReleased("right");
	if(osl_keys->released.select) onKeyReleased("select");
	if(osl_keys->released.start) onKeyReleased("start");
	if(osl_keys->released.R) onKeyReleased("R");
	if(osl_keys->released.L) onKeyReleased("L");
	if(osl_keys->released.triangle) onKeyReleased("triangle");
	if(osl_keys->released.circle) onKeyReleased("circle");
	if(osl_keys->released.cross) onKeyReleased("cross");
	if(osl_keys->released.square) onKeyReleased("square");
}
void captureHeld()
{
	if(osl_keys->held.up) onKeyHeld("up");
	if(osl_keys->held.down) onKeyHeld("down");
	if(osl_keys->held.left) onKeyHeld("left");
	if(osl_keys->held.right) onKeyHeld("right");
	if(osl_keys->held.select) onKeyHeld("select");
	if(osl_keys->held.start) onKeyHeld("start");
	if(osl_keys->held.R) onKeyHeld("R");
	if(osl_keys->held.L) onKeyHeld("L");
	if(osl_keys->held.triangle) onKeyHeld("triangle");
	if(osl_keys->held.circle) onKeyHeld("circle");
	if(osl_keys->held.cross) onKeyHeld("cross");
	if(osl_keys->held.square) onKeyHeld("square");
}
void capturePressed()
{
	if(osl_keys->pressed.up) onKeyPressed("up");
	if(osl_keys->pressed.down) onKeyPressed("down");
	if(osl_keys->pressed.left) onKeyPressed("left");
	if(osl_keys->pressed.right) onKeyPressed("right");
	if(osl_keys->pressed.select) onKeyPressed("select");
	if(osl_keys->pressed.start) onKeyPressed("start");
	if(osl_keys->pressed.R) onKeyPressed("R");
	if(osl_keys->pressed.L) onKeyPressed("L");
	if(osl_keys->pressed.triangle) onKeyPressed("triangle");
	if(osl_keys->pressed.circle) onKeyPressed("circle");
	if(osl_keys->pressed.cross) onKeyPressed("cross");
	if(osl_keys->pressed.square) onKeyPressed("square");
}
